package com.hgyc.mom.system.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.TableId;
import java.io.Serializable;

import com.hgyc.mom.core.annotation.DictColumn;
import com.hgyc.mom.core.annotation.TableDict;
import com.hgyc.mom.core.mybatis.EQ;
import com.hgyc.mom.core.mybatis.Like;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * <p>
 * 系统用户表
 * </p>
 *
 * @author fwj
 * @since 2025-01-16
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("sys_user")
@Schema(name = "系统用户表")
public class SysUser implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 主键ID
     */
    @TableId(value = "id", type = IdType.ASSIGN_ID)
    @Schema(name = "主键ID")
    private Long id;

    /**
     * 账号
     */
    @Like
    @Schema(name = "账号")
    private String account;

    @Schema(name = "密码")
    private String password;

    /**
     * 姓名
     */
    @Like
    @Schema(name = "姓名")
    private String name;

    @Schema(name = "部门ID")
    @TableDict(table = "sys_org", key="id", columns = {
            @DictColumn(name = "name", alias = "orgName")
    })
    private Long orgId;

    /**
     * 性别
     */
    @Schema(name = "性别")
    private String gender;

    /**
     * 邮件
     */
    @Schema(name = "邮件")
    private String email;

    /**
     * 电话
     */
    @Schema(name = "电话")
    private String phone;

    /**
     * 用户照片
     */
    @Schema(name = "用户照片")
    private String userPic;

    /**
     * 状态
     */
    @EQ
    @Schema(name = "状态")
    private Integer status;

    /**
     * 创建人
     */
    @Schema(name = "创建人")
    @TableField(fill = FieldFill.INSERT)
    private Long createBy;

    /**
     * 创建时间
     */
    @Schema(name = "创建时间")
    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime createTime;

    /**
     * 更新人
     */
    @Schema(name = "更新人")
    @TableField(fill = FieldFill.UPDATE)
    private Long updateBy;

    /**
     * 更新时间
     */
    @Schema(name = "更新时间")
    @TableField(fill = FieldFill.UPDATE)
    private LocalDateTime updateTime;


}
